package heap;

import java.util.ArrayList;
import java.util.HashMap;

public class ResultSchema {
	ArrayList < ResultField > list = new ArrayList < ResultField > () ;
	HashMap< String , Integer > map = new HashMap < String , Integer > () ;
	
	public void add ( ResultField rf )  {
		map.put (  rf.name.toLowerCase() , list.size() ) ; 
		list.add( rf ) ;
	}
	
	public int size()  {
		return list.size() ; 
	}
	
	public ResultField get ( int index ) { 
		return list.get ( index ) ; 
	}
	
	public int getNameIndex ( String name ) { 
		return map.get(name.toLowerCase()) ; 
	}
	
	public int getColumnType(int column)  {
		return list.get( column ).type ;
	}
}
